<template>
  <div class="splash-screen">
    <img src="/images/splash.webp" alt="启动过渡页" class="splash-img" />
    <div v-if="showLoading" class="loading-area">
      <div class="spinner"></div>
      <div class="loading-text">正在进入系统中...</div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

const showLoading = ref(false)

onMounted(() => {
  setTimeout(() => {
    showLoading.value = true
  }, 2000)
})
</script>

<style scoped>
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  z-index: 9999;
  overflow: hidden;
}
.splash-img {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  display: block;
}
.loading-area {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #e0e0e0;
  border-top: 4px solid #a89fdd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.2);
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading-text {
  color: #fff;
  font-size: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
  letter-spacing: 1px;
}
</style> 